-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a compatibility package to allow registering legacy wallet adapters as standard wallets #42
base: master
Are you sure you want to change the base?
Conversation
…rs as standard wallets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! I'll stop here with the feedback, and take another pass if you have the time to roll in some of the feedback.
The only other meta piece of feedback I have to offer (without actually having inspected the situation too closely) is that there's a lot of !
assertions everywhere. The target number of !
assertions, on the internet, should be zero. I have to believe that there's either something we can do to eliminate those, or worse that the presence of those is burying a bug.
@steveluscher thanks for the feedback!
Not really sure why I added all the ! assertions since they're not even doing anything (type-wise) seeing that Array[number] doesn't return |
This is an example implementation of an
Adapter
wrapper that conforms toWallet
. This allows registering anyAdapter
from@solana/wallet-adapter-wallets
in a@wallet-standard/base
Wallet
.This is potentially useful in the following scenarios:
@solana/wallet-adapter-react
to@wallet-standard/<>
packages since there is no dependency on adapters to upgrade their code.@wallet-standard
by just registering the adapter wrapper on demand (for example right before the user wants to connect). The implementation for this would need to provide name + icon since they are then no longer available from the wrapper (since it is not loaded yet).This PR merely serves as an example. There at least a few kinks that need to be worked out as well as some testing before there can be any talk about proceeding with this.
cc @jordaaash @steveluscher